// mircoApp/userAccount/comm/cardPopup/cardPopup.js
Component({

  /**
   * 组件的属性列表
   */
  options: {
    multipleSlots: true,  // 在组件定义时的选项中启用多slot支持
    addGlobalClass: true
  },
  properties: {
    cardTypeShow:Boolean,
    cardArr:Array,
    cardTitle:String,
    cardIndex:Number
  },

  /**
   * 组件的初始数据
   */
  data: {
  },

  /**
   * 组件的方法列表
   */
  methods: {
    cardTypeOn(event) {
      console.log(event);
      let {index} = event.currentTarget.dataset;
      this.setData({
        cardIndex:index
      })
    },
    cardClose() {
      this.setData({
        cardTypeShow:false
      })
      console.log(this.cardTypeShow);
    },
    cardConfrim() {
      this.setData({
        cardTypeShow:false
      })
      this.triggerEvent('cardConfrim', {cardIndex:this.data.cardIndex})
    }
  }
})